<?=$this->messages(); ?>
<?=$this->itemId($this->model_company->getID()) ?>
<?=$this->reloadFlag(true) ?>
<table>
    <tr>
        <td class="title">Caption:</td>
        <td class="input_field">
            <input type="text" name="caption" id="caption" value="<?=$this->model_company->getCaption(); ?>" />
        </td>
        <td class="description">&nbsp;</td>
    </tr>
    <tr id="tr_proxy">
        <td class="title">Proxy:</td>
        <td class="input_field">
            <input type="text" name="proxy" id="proxy" value="<?=$this->model_company->getProxy();?>" />
        </td>
        <td class="description">&nbsp;</td>
    </tr>
    <tr>
        <td class="title">Type:</td>
        <td class="input_field">
            <select name="type" id="company_type" onchange="event_onChangeCompanyType();" <? if (($this->action == "edit") || ($this->action == "view")) echo "disabled"; ?>>
                <option value="1" <? if ($this->model_company->isCompany()) echo "selected"; ?>>Company</option>
                <option value="2" <? if ($this->model_company->isPool()) echo "selected"; ?>>Pool</option>
                <option value="3" <? if ($this->model_company->isCompanyInPool()) echo "selected"; ?>>Company in an existing pool</option>
            </select>
        </td>
        <td class="description">
            &nbsp;
        </td>
    </tr>
    <tr <?=( ($this->model_company->isCompanyInPool()) ? "" : "style=\"display: none;\"") ?> id="tr_select_pool">
        <td class="title">Select Pool:</td>
        <td class="input_field">
            <select name="pool" id="pool" onchange="event_onChangePool();">
                <option value="0">---Select: ---</option>
<?
    foreach ($this->collection_pool as $model_pool)
    {
?>
                <option value="<?=$model_pool->getID() ?>" <? if ($this->model_company->isCompanyInPool() && ($this->model_company->getModelPool()->getID() == $model_pool->getID())) { echo "selected "; };?>><?=$model_pool->getCaption(); ?></option>
<?
    };
?>
            </select>
        </td>
        <td class="column3"></td>
    </tr>
    <tr id="tr_ip">
        <td class="title">IP/Mask:</td>
        <td class="input_field">
            <input type="text" name="ip" id="ip" value="<?=$this->model_company->getIP(); ?>" />
        </td>
        <td class="description">xxx.xxx.xxx.xxx/xxx OR xxx.xxx.xxx.xxx/xxx.xxx.xxx.xxx</td>
    </tr>
    <tr id="tr_vlan_id">
        <td class="title">VLAN ID:</td>
        <td class="input_field">
            <input class="input_text" type="text" name="vlan" id="vlan" value="<?=($this->model_company->getVlanID() != -1 ? $this->model_company->getVlanID() : "") ?>" />
        </td>
        <td class="description">Leave blank to disable.</td>
    </tr>
    <tr id="tr_vlan_pc_id">
        <td class="title">PC VLAN ID:</td>
        <td class="input_field">
            <input name="vlan_pc" type="text" id="vlan_pc" value="<?=($this->model_company->getVlanPcID() != -1 ? $this->model_company->getVlanPcID() : "") ?>" />
        </td>
        <td class="description">Leave blank to disable. Won't work without VLAN ID!</td>
    </tr>
    <tr>
        <td colspan="3"><input name="previous_type" type="hidden" id="previous_type" value="<?=$this->model_company->getType(); ?>" /></td>
    </tr>
</table>
<?=$this->buttons(); ?>